package com.solution.pc.order.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.pc.order.dao.OrderAlipayNotifyLogDao;
import com.solution.pc.order.entity.OrderAlipayNotifyLogEntity;
import com.solution.pc.order.service.OrderAlipayNotifyLogService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 订单支付宝支付日志service实现层
 * @author llp
 * @date 2017-10-19 09:36:39
 */
@Service
public class OrderAlipayNotifyLogServiceImpl extends BaseServiceImpl<OrderAlipayNotifyLogEntity> implements OrderAlipayNotifyLogService {

	/**
	 * 订单支付宝支付日志接口
	 */
	@Autowired
	private OrderAlipayNotifyLogDao orderAlipayNotifyLogDao;

	protected BaseDao<OrderAlipayNotifyLogEntity> getDao() {
		return this.orderAlipayNotifyLogDao;
	}

	/**
	 * 保存订单支付宝支付日志
	 * @param orderAlipayNotifyLogEntity 订单支付宝支付日志实体
	 * @return Long 添加成功订单支付宝支付日志的ID
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	public long saveOrderAlipayNotifyLog(OrderAlipayNotifyLogEntity orderAlipayNotifyLogEntity) {
		return orderAlipayNotifyLogDao.saveOrderAlipayNotifyLog(orderAlipayNotifyLogEntity);
	}

	/**
	 * 分页查询订单支付宝支付日志
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	@Override
	public PageBean listOrderAlipayNotifyLogPage(PageParam pageParam, Map<String, Object> paramMap) {
		return orderAlipayNotifyLogDao.listOrderAlipayNotifyLogPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return orderAlipayNotifyLogEntity 用户对象
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	public OrderAlipayNotifyLogEntity getOrderAlipayNotifyLogById(Long id) {
		return orderAlipayNotifyLogDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param orderAlipayNotifyLogEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	@Override
	public int updateOrderAlipayNotifyLog(OrderAlipayNotifyLogEntity orderAlipayNotifyLogEntity) {
		return orderAlipayNotifyLogDao.updateOrderAlipayNotifyLog(orderAlipayNotifyLogEntity);
	}
	
	
	/**
	 * 根据条件查询订单支付宝支付日志
	 * @param param
	 * @return 数据列表
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	@Override
	public List<OrderAlipayNotifyLogEntity> listOrderAlipayNotifyLog( Map<String, Object> param){
		return  orderAlipayNotifyLogDao.listOrderAlipayNotifyLog(param);
	}
	
	/**
	 * 删除订单支付宝支付日志
	 * @param 
	 * @return int 返回删除记录条数
	 * @author llp
	 * @date 2017-10-19 09:36:39
	 */
	public int deleteOrderAlipayNotifyLogById(long id){
		return  orderAlipayNotifyLogDao.deleteById(id);
	}
	
}
